package com.lupan.springboot;

import com.mangofactory.swagger.configuration.SpringSwaggerConfig;
import com.mangofactory.swagger.models.dto.ApiInfo;
import com.mangofactory.swagger.plugin.EnableSwagger;
import com.mangofactory.swagger.plugin.SwaggerSpringMvcPlugin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 说明：swagger配置文件
 *
 * @author lupan
 * @version 2017/6/6 14:10
 */

@Configuration
@EnableSwagger
public class MySwaggerConfig {

    @Autowired
    private SpringSwaggerConfig swaggerConfig;

    @Bean
    public SwaggerSpringMvcPlugin customImplementation()
    {
        return new SwaggerSpringMvcPlugin(this.swaggerConfig)
                .apiInfo(apiInfo()).includePatterns(".*?");
    }

    private ApiInfo apiInfo()
    {
        ApiInfo apiInfo = new ApiInfo(
                "学生管理系统",
                "一个管理学生的系统",
                "My Apps API terms of service",
                "My Apps API Contact Email（729863487@qq.com）",
                "My Apps API Licence Type（授权类型）",
                "www.lupan.com");
        return apiInfo;
    }
}
